package com.yh.test;

import java.io.*;
import java.net.URL;
import java.net.URLConnection;

public class baidu {
    public static void main(String[] args) throws IOException
    {
        try
        {
            int count = 0;
            int s =9000;
            int e =10000;
            BufferedReader br = new BufferedReader(new FileReader("D:\\1.txt"));
            String line = br.readLine();
            while(line !=null)
            {

                if(count>=s && count<=e)
                {
                    getStringByEnter(20,line);
                    System.out.println(line);
                }

                line = br.readLine();
                count++;
            }
        }
        catch(Exception e)
        {
        }
    }

    public static String getStringByEnter(int length, String string) throws Exception
        {
       for (int i = 1; i <= string.length(); i++)
               {
                 if (string.substring(0, i).getBytes("utf-8").length > length)
                        {
                            return string.substring(0, i - 1) + "\n" +
                                     getStringByEnter(length, string.substring(i - 1));
                         }
                }
              return string;
          }
}



